//  物料汇总表 api

import { ajaxService } from '@/utils/request';

const env = import.meta.env;
let baseURL = env.VITE_BUY_URL;

// 获取表头设置
export function getPurchaseHeader(params: any) {
  return ajaxService({
    url: '/purchase/list/header/get',
    params,
    method: 'get',
    baseURL,
  });
}

// 修改表头设置
export function PUTPurchaseHeader(data: any) {
  return ajaxService({
    url: '/purchase/list/header/edit',
    data,
    method: 'put',
    baseURL,
  });
}

// 获取列表数据
export function getPurchaseProductList(params: any) {
  return ajaxService({
    url: '/purchase/list/product/getAll',
    params,
    method: 'get',
    baseURL,
  });
}

// 获取拥有该物料的供应商物料
export function getPurchaseProductNumber(params: any) {
  return ajaxService({
    url: '/purchase/list/product/getByNumber',
    params,
    method: 'get',
    baseURL,
  });
}

// 获取物料详情
export function getPurchaseDetails(params: any) {
  return ajaxService({
    url: '/purchase/list/product/get',
    params,
    method: 'get',
    baseURL,
  });
}

// 获取物料详情
export function postPurchaseAddByOrder(data: any) {
  return ajaxService({
    url: '/purchase/list/order/addBy/product',
    data,
    method: 'post',
    baseURL,
  });
}
